package com.yogurt.excel.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.yogurt.excel.Student;

import java.util.Map;

/**
 * @Auther: 酸奶
 * @Date: 2020/07/09 15:38
 * @Description: EasyExcel 读的监听器
 */
public class ExcelListener extends AnalysisEventListener<Student> {

    //一行一行的读取excel的内容
    @Override
    public void invoke(Student student, AnalysisContext analysisContext) {
        System.out.println(student.getOneSubjectName() + "======" + student.getTwoSubjectName());
    }
    //读取表头的内容
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息" + headMap);
    }

    //读取完成后执行
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
